package com.sfzy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sfzy.mapper.MyConsultMapper;
import com.sfzy.service.MyConsultService;
import com.sfzy.entity.MyConsult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class MyConsultServiceImpl implements MyConsultService {
    @Autowired
    private MyConsultMapper myConsultMapper;

    @Override
    public int addMyConsult(MyConsult myConsult) {
        return myConsultMapper.addMyConsult(myConsult);
    }

    @Override
    public int updateMyConsult(MyConsult myConsult) {
        return myConsultMapper.updateMyConsult(myConsult);
    }

    @Override
    public int deleteMyConsult(int id) {
        return myConsultMapper.deleteMyConsult(id);
    }

    @Override
    public MyConsult getMyConsult(int id) {
        return myConsultMapper.getMyConsult(id);
    }

    @Override
    public List<MyConsult> listMyConsult() {
        return myConsultMapper.listMyConsult();
    }

    @Override
    public PageInfo<MyConsult> listMyConsultByPage(MyConsult myConsult, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<MyConsult> list=myConsultMapper.listMyConsult();
        PageInfo<MyConsult> pageInfo=new PageInfo<>(list);
        return pageInfo;
    }
}
